﻿<%@ Page Title="Topic" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Topic.aspx.cs" Inherits="Snow.Topic" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
        }
        .style2
        {
        }
        .style3
        {
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table style="width: 100%;">
        <tr>
            <td class="style3">
                <asp:Label ID="lblTid" runat="server" Text="Tid:"></asp:Label>
                &nbsp; &nbsp; Uid:
                <asp:TextBox ID="txtUid" runat="server" Width="108px"></asp:TextBox>
                &nbsp; &nbsp;
                <asp:DropDownList ID="ddlModuleA" runat="server" Style="margin-left: 0px">
                    <asp:ListItem Value="0">----0</asp:ListItem>
                    <asp:ListItem Value="1">----1</asp:ListItem>
                    <asp:ListItem Value="2">----2</asp:ListItem>
                    <asp:ListItem Value="3">----3</asp:ListItem>
                </asp:DropDownList>
                &nbsp;&nbsp; Time:<asp:TextBox ID="txtTime" runat="server" Width="147px"></asp:TextBox>
                &nbsp;&nbsp; UV:<asp:TextBox ID="txtUV" runat="server" Width="147px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Title:<asp:TextBox ID="txtTitle" runat="server" Width="643px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                <asp:TextBox ID="txtCount" runat="server" Width="100%" TextMode="MultiLine" Height="211px"></asp:TextBox>
            </td>
        </tr>
    </table>
    <asp:Button ID="btnAdd" runat="server" Text=" Add  " OnClick="btnAdd_Click" Width="89px"
        Height="26px" />
    &nbsp;
    <asp:Button ID="btnEdit" runat="server" Text="  Edit " OnClick="btnEdit_Click" Width="89px"
        Height="26px" />
    <br />
    <hr />
    <br />
    <asp:DropDownList ID="ddlModule" runat="server">
        <asp:ListItem Value="999">--All--</asp:ListItem>
        <asp:ListItem Value="0">----0</asp:ListItem>
        <asp:ListItem Value="1">----1</asp:ListItem>
        <asp:ListItem Value="2">----2</asp:ListItem>
        <asp:ListItem Value="3">----3</asp:ListItem>
    </asp:DropDownList>
    <asp:Button ID="btnQuery" runat="server" Text="Query" OnClick="btnQuery_Click" />
    <br />
    <hr />
    <asp:GridView ID="gvTopic" runat="server" AutoGenerateColumns="False" OnRowDeleting="gvTopic_RowDeleting"
        OnSelectedIndexChanging="gvTopic_SelectedIndexChanging" DataKeyNames="tid" AllowPaging="True"
        OnPageIndexChanging="gvTopic_PageIndexChanging" PageSize="20">
        <Columns>
            <asp:BoundField HeaderText="tid" DataField="tid" />
            <asp:BoundField HeaderText="uid" DataField="uid" />
            <asp:BoundField DataField="module" HeaderText="module" />
            <asp:TemplateField HeaderText="title">
                <ItemTemplate>
                    <a href='<%=Domain%>Announce.aspx?tid=<%#Eval("uid") %>&module=<%#Eval("module") %>'
                        target="_blank">
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("title") %>'></asp:Label></a>
                </ItemTemplate>
                <ItemStyle Width="30%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Content">
                <ItemTemplate>
                    <%#Eval("content").ToString().Length > 100 ? Eval("content").ToString().Substring(0, 100)+"... ..." : Eval("content")%>
                </ItemTemplate>
                <ItemStyle Width="50%" />
            </asp:TemplateField>
            <asp:BoundField HeaderText="time" DataField="time" />
            <asp:BoundField HeaderText="uv" DataField="uv" />
            <asp:TemplateField HeaderText="reply">
                <ItemTemplate>
                    <a href='reply.aspx?tid=<%#Eval("tid") %>' target="_blank">
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("reply_count") %>'></asp:Label></a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowSelectButton="True" />
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
    </asp:GridView>
</asp:Content>
